package com.purchase.manage.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.purchase.manage.damian.OrderQuotationProduct;
import com.purchase.manage.mapper.OrderQuotationProductMapper;
import com.purchase.manage.service.IOrderQuotationProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 产品询价表 服务实现类
 * </p>
 *
 * @author chuan
 * @since 2023-07-06
 */
@Service
public class OrderQuotationProductServiceImpl extends ServiceImpl<OrderQuotationProductMapper, OrderQuotationProduct> implements IOrderQuotationProductService {
    @Autowired
    OrderQuotationProductMapper orderQuotationProductMapper;
    public int insertQuotationProduct(List<OrderQuotationProduct> orderQuotationProducts){
        for (OrderQuotationProduct item:orderQuotationProducts){
            if(orderQuotationProductMapper.addOrderQuotationProduct(item)<1){
                throw new SecurityException("添加失败");
            }
        }

        return 1;
    }
}
